#include <iostream>
#include <cstring>

using namespace std;
int t , n , m;
const int N = 110 , M = 1e4 + 10;
int p[N][N];
int dp[M];

int solve(int v[] , int w[] , int m)
{
    memset(dp , 0 , sizeof dp);
    for(int i = 1;i <= n;i ++)
    {
        for(int j = v[i];j <= m;j ++)
        {
            dp[j] = max(dp[j] , dp[j-v[i]] + w[i] - v[i]);
        }
    }
    return m + dp[m];
}
int main()
{
    cin >> t >> n >> m;
    for(int i = 1;i <= t;i ++)
        for(int j = 1;j <= n;j++)
            cin >> p[i][j];

    for(int i = 1;i < t;i ++)
    {
        m = solve(p[i] , p[i+1] , m);
    }
    cout << m << endl;
    return 0;
}